﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace Upreader.Application.Model
{
    /// <summary>
    /// Represents information regarding the server
    /// </summary>
    public class Server : ModelBase
    {
        #region Properties

        /// <summary>
        /// Get or set a collection of groups available for this server
        /// </summary>
        public ICollection<string> AvailableGroups { get; set; }

        /// <summary>
        /// Get or set the title for this server. This is purely for visual representation
        /// </summary>
        [Required(AllowEmptyStrings = false)]
        public string Title { get; set; }

        /// <summary>
        /// Get or set the address of this server
        /// </summary>
        [Required(AllowEmptyStrings = false)]
        public string Address { get; set; }

        /// <summary>
        /// Get or set the port where this server should connect to
        /// </summary>
        public int Port { get; set; }

        /// <summary>
        /// Get or set wether a secured connection (SSL) is required for this server
        /// </summary>
        public bool IsSecuredConnection { get; set; }

        /// <summary>
        /// Get or set a username for this server
        /// </summary>
        [Required(AllowEmptyStrings = false)]
        public string UserName { get; set; }

        /// <summary>
        /// Get or set the password required by this server
        /// </summary>
        [Required(AllowEmptyStrings = false)]
        public string Password { get; set; }

        /// <summary>
        /// Get or set wether authentication on this server is required
        /// </summary>
        public bool IsAuthenticationRequired { get; set; }

        /// <summary>
        /// Get or set the moment in time when this file was inserted
        /// </summary>
        public DateTime Inserted { get; set; }

        /// <summary>
        /// Get or set the priority of the server
        /// </summary>
        public int Priority { get; set; }

        /// <summary>
        /// Get or set the amount of connections that should be used for this server
        /// </summary>
        public int ConnectionCount { get; set; }

        /// <summary>
        /// Get or set whether the current server is enabled for use
        /// </summary>
        public bool Enabled { get; set; }

        /// <summary>
        /// Get or set the total amount of bytes sent over this server
        /// </summary>
        public long TotalBytesSent { get; set; }

        /// <summary>
        /// Get or set the total amount of bytes received from this server
        /// </summary>
        public long TotalBytesReceived { get; set; }

        #endregion // Properties
    }
}
